<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<title>Rich Text Editor 4testonly</title>
      <script type="text/javascript" language="JavaScript">
        var eXo = function() {} ;
        eXo.core = function() {} ;
        
        /**
         * 
         * @param {Object} obj
         * @param {Boolean} returnVal
         */
        function objectInjection(obj, returnVal) {
          /**
           * @type {String}
           */
          var objStatistic = '' ;
          /**
           * @type {Number}
           */
          var cnt = 1 ;
          for (var iter in obj) {
            objStatistic += '\n' + cnt + '.' + iter + ': ' + typeof obj[iter] ;
            if (typeof obj[iter] == 'string') {
              try {
                objStatistic += '->' + obj[iter] ;
              } catch (e) {window.alert('error occured! ' + e) ;}
            }
            cnt ++ ;
          }
          if (!returnVal) {
            window.alert(objStatistic) ;
          } else {
            return objStatistic ;
          }
        } ;
        
      </script>  
      <script language="JavaScript" type="text/javascript" src="../../eXo/core/html/HTMLEntities.js"></script>
      <script language="JavaScript" type="text/javascript" src="../../eXo/core/HTMLUtil.js"></script>
      <script language="JavaScript" type="text/javascript" src="../../eXo/core/Util.js"></script>
      <script language="JavaScript" type="text/javascript" src="../../eXo/core/OS.js"></script>
      <script language="JavaScript" type="text/javascript" src="../../eXo/core/Browser.js"></script>
      <script language="JavaScript" type="text/javascript" src="../../eXo/core/DefaultKeyboardListener.js"></script>
      <script language="JavaScript" type="text/javascript" src="../../eXo/core/text/RichTextEditor.js"></script>
      <script language="JavaScript" type="text/javascript" src="../../eXo/core/CoreEditor.js"></script>
      <script language="JavaScript" type="text/javascript" src="../../eXo/core/text/RTEManager.js"></script>
      <script language="JavaScript" type="text/javascript" src="../../eXo/core/Keyboard.js"></script>
      <script language="JavaScript" type="text/javascript" src="LogEngine.js"></script>
      <link rel="stylesheet" type="text/css" href="LogEngineStyle.css">
      <style type="text/css">
        .RedText {
          color: #ff0000;
        }
        
        .BlueText {
          color: #0000ff;
        }
        
        .ConsoleCursor {
          height: 2px ;
          width: 5px ;
          border: solid 1px blue ;
          font-size: 2px ;
        }
        
        .ControlPanel {
          border: solid 1px green ;
          margin: 10px ;
          padding: 5px ;
        }
        
        .Button {
          padding: 2px ;
          cursor: pointer ;
          border-left: solid 2px red ;
          border-top: solid 1px red ;
          border-bottom: solid 1px red ;
          border-color: #000000 ;
          color: #00aa00 ;
          background-color: #dddddd ;
        }
        
        .Button:hover {
          cursor: pointer ;
          border-left: none ;
          border-right: solid 2px green ;
          border-top: solid 1px green ;
          border-bottom: solid 1px green ;
          border-color: red ;
        }
      </style>
	</head>
	<body>
	  <div style="font-weight: bold" id="firstNode">
	    Rich Text Editor offline test version.
	  </div>
    <div class="ControlPanel">
      <a class="Button" onmousedown="eXo.core.text.RTEManager.init(); return false ;">Prepare change style</a>
      <a class="Button" onmousedown="return false ;">Bold</a>
      <a class="Button" onmousedown="return false ;">Italic</a>
    </div>
    <div class="Editor" id="line1" editcontainer="1" handler="eXo.core.text.RichTextEditor" multiselect="1">
      Test something 
      <span class="RedText" editable="1">with red text...</span>
      <span class="BlueText" editable="1"> and this is blue text</span>
    </div>
    <hr>
    <div class="Editor" editcontainer="1" handler="eXo.core.text.RichTextEditor">
      <span class="RedText" editable="1">Editable</span>
      <span>can not change this node</span>
      <span class="BlueText" editable="1">edit me</span>
      <span>(static content) - </span>
      [static content in text node]
      <span class="BlueText" editable="1">nice to meet u</span>
    </div>
    
    <script language="JavaScript" type="text/javascript">
      eXo.core.CoreEditor.registerCoreEditors(document.body) ;
//      eXo.core.LogEngine.createLogPanel() ;
//      document.onmouseup = function() {
//        var selObj = window.getSelection() ;
//        window.alert(selObj.anchorNode.nodeValue) ;
//      } ;
    </script>
	</body>
</html>
